package cn.bs.seckill.controller;


import cn.bs.seckill.pojo.User;
import cn.bs.seckill.service.GoodsService;
import cn.bs.seckill.service.OrdersService;
import cn.bs.seckill.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  订单页
 * </p>
 *
 * @author 布索
 * @since 2022-03-01
 */
@Controller
@RequestMapping("/order")
public class OrdersController {
    @Autowired
    private OrdersService ordersService;

    @GetMapping("/detail")
    @ResponseBody
    public RespBean detail(User user, Long orderId){
        if (null==user){
            return RespBean.error(RespBeanEnum.LOGIN_ERROR);
        }
        DetailVo detail=ordersService.detail(orderId);
        return RespBean.success(detail);
    }
}
